// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import BaseUI from "../framwork/BaseUI";
import gridItem from "./gridItem";

const {ccclass, property} = cc._decorator;

@ccclass
export default class grids extends BaseUI {
    private static _instance: grids = null;
    public static getInstance(): grids {
        return grids._instance;
    }
    baseUI_onLoad(): void {
        grids._instance = this;
        let allGridItems = this.getAllGridItems()
        allGridItems[12].setData({
            id:0,
            name:"核心",
            huanguan:0
        })
        console.log(allGridItems);
    }
    baseUI_onDestroy(): void {

    }
    onBtn_click(target: cc.Button, onBtn_name: string): number | void {

    }
    init_data(d: any): void {

    }
    getAllGridItems(){
        return this.getComponentsInChildren(gridItem);
    }
}
